import java.util.ArrayList;
import java.util.List;

public class project {
    public List<Integer> goodDaysToRobBank(int[] security, int time) {
        List<Integer> list=new ArrayList<>();
        int len=security.length;
        int[] left=new int[len];
        int[] right=new int[len];
        for(int i=1;i<len;i++){
            if(security[i]<=security[i-1]){
                left[i]=left[i-1]+1;
            }
            if(security[len-i-1]<=security[len-i]){
                right[len-i-1]=right[len-i]+1;
            }
        }
        for(int i=time;i<len-time;i++){
            if(left[i]>=time&&right[i]>=time){
                list.add(i);
            }
        }
        return list;
    }
}
